package com.guchenbo.scala.c1

/**
 * @author guchenbo
 * @date 2022/3/15
 */
class Student2(name: String, age: Int) {
  println(s"name=$name, age=$age")
}

class Student3(var name: String, val age: Int) {
  println(s"name=$name, age=$age")
}

object Student2 {

  def main(args: Array[String]): Unit = {
    val demo = new Student2("jay", 18)
    println(demo)
//    demo.name error

    val demo2 = new Student3("jay", 18)
    println(demo2.name)
    println(demo2.age)
    demo2.name = "jay2"
    //    demo2.age=19// error
  }
}
